* Clean up
clear all

/* Set working directory: please set your own
cd "~/Dropbox/JOP third submission/JOP replication/"
*/

* Open dataset

use 01_data/cis_data.dta, clear

* Run analyses
regr cabine_use cs_dummy if pp_dummy == 0, r
est store other_cs_nocontrols
estadd local Controls "No"

regr cabine_use cs_dummy female i.income age age_sq i.education i.TAMUNI i.CCAA if pp_dummy == 0, r
est store other_cs_controls
estadd local Controls "Yes"

regr cabine_use vox_dummy if pp_dummy == 0, r
est store other_vox_nocontrols
estadd local Controls "No"

regr cabine_use vox_dummy female i.income age age_sq i.education i.TAMUNI i.CCAA if pp_dummy == 0, r
est store other_vox_controls
estadd local Controls "Yes"

* Make table (without full list of controls)
esttab other_cs_nocontrols other_cs_controls other_vox_nocontrols other_vox_controls using 03_tables/tablef1.tex, tex se replace keep(cs_dummy vox_dummy) coeflabels (cs_dummy "Ciudadanos voter" vox_dummy "Vox voter") nomtitles star(* 0.10 ** 0.05 *** 0.01) s(Controls, label("Controls")) addnotes("Standard errors are robust" "The outcome variable is a dummy for whether each respondent used a private" "voting booth to cast their vote in the general election of November 2019" "Models 2 and 4 include controls for income, education, age, age squared, size of" "respondent's municipality, and a dummy for respondents identifying as female" "The analyses exclude respondents who voted for PP") scalars(e(N))
